package com.example.springboot.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.springboot.dto.StoryDTO;
import com.example.springboot.entity.Story;
import com.example.springboot.entity.StoryComment;

import java.util.List;
import java.util.Map;

public interface StoryService extends IService<Story> {
    StoryDTO selectStoryById(Long id);

    IPage<StoryDTO> getStoryList(Page<Story> page);

    void incrementViews(Long id);

    IPage<StoryDTO> getHotStories(Page<Story> page);
    
    // 新增方法
    IPage<StoryDTO> getStoriesByCategory(String category, Page<Story> page);
    
    IPage<StoryDTO> getStoriesByDestination(Long destinationId, Page<Story> page);
    
    IPage<StoryDTO> getStoriesByAuthor(Long authorId, Page<Story> page);
    
    IPage<StoryDTO> searchStories(String keyword, Page<Story> page);
    
    List<String> getAllCategories();
    
    Map<String, Object> getStoryStats();
    
    void incrementLikes(Long id);
    
    void addComment(StoryComment comment);
    
    List<StoryDTO> getRelatedStories(Long id, Integer size);
    
    List<StoryDTO> getLatestStories(Integer size);
}